/**
 * Copyright &copy; 2015-2020 <a href="www.dsesa.cn/">ESA</a> All rights reserved.
 */
package com.jeeplus.modules.act.mapper;

import com.jeeplus.core.persistence.BaseMapper;
import com.jeeplus.core.persistence.Page;
import com.jeeplus.core.persistence.annotation.MyBatisMapper;
import com.jeeplus.modules.act.entity.Act;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 审批Mapper接口
 * @author jeeplus
 * @version 2017-05-16
 */
@MyBatisMapper
public interface ActMapper extends BaseMapper<Act> {

	public int updateProcInsIdByBusinessId(Act act);

	//获取businessKey
	String getInfoByProInsId(Act act);

	//获取procInsId  by  key
	String getProInsIdByKey(@Param("businessTable") String businessTable, @Param("businessId") String businessId);

	//更新主表状态
	int updateFlagByBusinessId(@Param("businessId") String businessId, @Param("businessTable") String businessTable);

	List<HashMap> getMyChaoSong(@Param("userId")String userId,@Param("page") Page page);

	int setChaoSong(@Param("id") String id,
					@Param("procInsId") String procInsId,
					@Param("userFrom") String userFrom,
					@Param("userTo") String userTo,
					@Param("userTos") String userTos,
					@Param("isread") String isread,
					@Param("createTime") Date createTime,
					@Param("executionId") String executionId);

	int delete(@Param("id") String id);

	int upToRead(@Param("id") String id);

	long getCountCs(@Param("userId") String userId);

	List<Map> getCSList(@Param("procInsId") String procInsId);

	void saveToken(@Param("accessToken") String accessToken, @Param("createDate") Date createDate);

	String findCurrToken();

	Map<String,String> getActTitle(@Param("procInsId") String procInsId);

	//2021-07-23 自定义查询我的申请列表
	List<HashMap> getMyApply(@Param("pageNo") int pageNo,
							 @Param("pageSize") int pageSize,
							 @Param("applyUser") String applyUser,
							 @Param("varTitle") String varTitle,
							 @Param("procDefName") String procDefName);

	//2022-03-07 所有流程
	List<HashMap> getMyApplyAll(@Param("pageNo") int pageNo,
							    @Param("pageSize") int pageSize,
							    @Param("applyUser") String applyUser,
								@Param("varTitle") String varTitle,
								@Param("procDefName") String procDefName,
								@Param("beginDate") Date beginDate,
								@Param("endDate") Date endDate,
								@Param("zt") String zt);


	//2021-07-23 自定义查询我的申请列表
	List<HashMap> getMyHistoric(@Param("pageNo") int pageNo,
							    @Param("pageSize") int pageSize,
							    @Param("applyUser") String applyUser,
							    @Param("varTitle") String varTitle,
							    @Param("procDefName") String procDefName,
								@Param("beginDate") Date beginDate,
								@Param("endDate") Date endDate);
}
